package experiment2;

public class No5 {
    public static void main(String []args)
    {
        No5 k=new No5();
        k.method_1();
        k.method_2();
    }


    public void method_1()
    {

        for(int i=1;i<=6;i++)
        {
            for (int k=1;k<=i;k++)
            {
                System.out.print(k+" ");
            }
            System.out.println();
        }
    }

    public void method_2()
    {
        int i=1;
        while (i<=6)
        {
            int k=1;
            while (k<=i)
            {
                System.out.print(k+" ");
                k++;
            }
            System.out.println();
            i++;
        }
    }
}

